﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

//using GriffinWebService.BO;
using GriffinWebService.Entity; 

namespace GriffinWebService.test
{
    public partial class testWebService : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string message = string.Empty;
            string username = this.username.Text;
            string password = this.password.Text;
            string email = this.email.Text;

            User user = new User();
            user.Username =username;
            user.Password = password;
            user.Email = email;

            cn.ciandt.griffin.Service1 service = new GriffinWebService.cn.ciandt.griffin.Service1();
            //Service1 service = new Service1();
            int res = service.register(user.Username,user.Password,user.Email, out message);
            this.message.Text = "[User]:" + res + " [message]:" + message;

        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            string message = string.Empty;
            string username = this.username.Text;
            string password = this.password.Text;
            string email = this.email.Text;

            Service1 service = new Service1();
            int res = service.login(username, password,out message);
            this.message.Text = "[res]:" + res.ToString() + " [message]:" + message;
        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            string message = string.Empty;
            cn.ciandt.griffin.Service1 service = new GriffinWebService.cn.ciandt.griffin.Service1();

            //List<Evaluation> listEvaluation = service.getCateEvaluation(1, out message);
            //decimal d = service.getSiteEvaluation(1, 2, out message);
            decimal dec = 7.8m;
            //int b = service.setEvaluation(9, 9, 1, dec, out message);

            String res = service.getCateEvaluation(1, out message);
            this.message.Text = "[res]:" + res.ToString() + " [message]:" + message;
            //List<Evaluation> listEvaluation = service.getCateEvaluation(1, out message);

            //this.message.Text = "[res]" + listEvaluation

        }

        protected void Button4_Click(object sender, EventArgs e)
        {
            string message = string.Empty;
            Service1 service = new Service1();
            decimal b = service.getSiteEvaluation(38,2010101, out message);
        }


    }
}
